package br.com.jogo;

import br.com.jogo.assets.Assets;
import br.com.jogo.screens.BattleScreen;
import br.com.jogo.services.PreferencesManager;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.FPSLogger;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;

public class MagesGame extends Game {

	public static final boolean DEV_MODE = false;
	public static final String LOG = "Mages Log:";
	FPSLogger fpsLogger;
	public SpriteBatch batcher;

	public final int GAME_WIDTH = 480;
	public final int GAME_HEIGHT = 320;

	public PreferencesManager preferencesManager;

	@Override
	public void create() {
		batcher = new SpriteBatch();
		fpsLogger = new FPSLogger();
		Assets.load();

		// create the preferences manager
		preferencesManager = new PreferencesManager();

		setScreen(new BattleScreen(this));

	}

	@Override
	public void render() {
		super.render();
		// fpsLogger.log();
	}

	/**
	 * {@link Game#dispose()} only calls {@link Screen#hide()} so you need to
	 * override {@link Game#dispose()} in order to call {@link Screen#dispose()}
	 * on each of your screens which still need to dispose of their resources.
	 */
	@Override
	public void dispose() {
		super.dispose();
		batcher.dispose();
		Assets.dispose();
		getScreen().dispose();
	}
}
